package com.snopy.designPattern.filter.impl;

import com.snopy.designPattern.filter.bean.Person;
import com.snopy.designPattern.filter.inter.Criteria;

import java.util.ArrayList;
import java.util.List;

/**
 * @author snopy
 * @version 1.0.0
 * @classname FemalCriteria
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/03 10:02
 */
public class FemaleCriteria implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> persons) {
        List<Person> list = new ArrayList<>();
        for (Person p:persons) {
            if (p.getGender().equalsIgnoreCase("FEMALE")){
                list.add(p);
            }
        }
        return list;
    }
}
